package com.tbl.gamecaro;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.widget.ImageView;

public class Result extends Activity {
	ImageView img1, img2, img3;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);
        img3 = (ImageView)findViewById(R.id.imageView1);
        img1 = (ImageView)findViewById(R.id.imageView2); //o
        img2 = (ImageView)findViewById(R.id.imageView3); //x
        img1.setVisibility(android.view.View.INVISIBLE);
        img2.setVisibility(android.view.View.INVISIBLE);
        img3.setVisibility(android.view.View.INVISIBLE);
        Intent intent = getIntent();
        Bundle bundle = intent.getExtras();
        
        switch (bundle.getInt("thang")) {
		case 0:
			img2.setVisibility(android.view.View.VISIBLE);
			break;

		case 1:
			img1.setVisibility(android.view.View.VISIBLE);
			break;
		case 2:
			 img3.setVisibility(android.view.View.VISIBLE);
			break;
		}
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_result, menu);
        return true;
    }
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if ((keyCode == KeyEvent.KEYCODE_BACK)) {
            Log.d(this.getClass().getName(), "back button pressed");
            //moveTaskToBack(true);
            android.content.Intent intent = new android.content.Intent(getApplicationContext(),Splash.class);
			startActivity(intent);
        }
        return super.onKeyDown(keyCode, event);
    }
    
}
